package com.shy.springframework.test.bean;

import com.shy.springframework.beans.factory.annotation.Autowired;
import com.shy.springframework.beans.factory.annotation.Qualifier;
import com.shy.springframework.stereotype.Component;

/**
 * @author yzpang
 * @desc:
 * @date: 2023/2/14 13:24
 */
@Component
public class Wife {
    @Autowired
    private Husband husband;

    @Autowired
    @Qualifier("mother")
    private IMother mother;

    public Husband getHusband() {
        return husband;
    }

    public void setHusband(Husband husband) {
        this.husband = husband;
    }

    public IMother getMother() {
        return mother;
    }

    public void setMother(IMother mother) {
        this.mother = mother;
    }

    public String queryHusband(){
        return "Wife.husband. Call mother: " + mother.callMother();
    }
}
